Skip to content

Add shared memory and DNS resolution support #99

Merged
kr-t merged 8 commits intomainfrom
features/opcua
Nov 19, 2025
Merged

Add shared memory and DNS resolution support #99
kr-t merged 8 commits intomainfrom
features/opcua

Conversation

@kr-t
Copy link
Collaborator

@kr-t kr-t commented Nov 13, 2025

Description

Improvement of wasm stack - additional networking and shared memory support

  • Fixes issue #

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Tests on Linux, Zephyr and CI

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes

kr-t added 2 commits November 13, 2025 21:07
Signed-off-by: Krisztian Szilvasi <34309983+kr-t@users.noreply.github.com>
Signed-off-by: Krisztian Szilvasi <34309983+kr-t@users.noreply.github.com>
@kr-t kr-t requested a review from srberard as a code owner November 13, 2025 20:56
kr-t added 6 commits November 13, 2025 22:07
Signed-off-by: Krisztian Szilvasi <34309983+kr-t@users.noreply.github.com>
Signed-off-by: Krisztian Szilvasi <34309983+kr-t@users.noreply.github.com>
Signed-off-by: Krisztian Szilvasi <34309983+kr-t@users.noreply.github.com>
Signed-off-by: Krisztian Szilvasi <34309983+kr-t@users.noreply.github.com>
Signed-off-by: Krisztian Szilvasi <34309983+kr-t@users.noreply.github.com>
Signed-off-by: Krisztian Szilvasi <34309983+kr-t@users.noreply.github.com>
@kr-t kr-t requested review from SorinOlari and casaroli November 19, 2025 09:25
// Shared heap for memory-mapped access
wasm_shared_heap_t _shared_heap = NULL;
#ifdef CONFIG_OCRE_SHARED_HEAP_BUF_VIRTUAL
uint8 preallocated_buf[CONFIG_OCRE_SHARED_HEAP_BUF_SIZE];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we allocate and put this in the external ram (storage_malloc) or (user_malloc) instead of making it global/static?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am fine with either - but with current solution we would still use system memory (just allocated dynamically) on systems with no PSRAM, will need to cut a bit WAMR's linear memory and allocate/deallocate memory during the runtime init.
I propose the following: we keep it this way as initial commit for this features, and once the shared_memory is available and non-kernel stuff are using the same pull, we will move everything (inc. this) to use that.


#ifdef CONFIG_OCRE_SHARED_HEAP_BUF_PHYSICAL
// Physical mode - map hardware register address
heap_init_args.pre_allocated_addr = (void *)CONFIG_OCRE_SHARED_HEAP_BUF_ADDRESS;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like something very dangerous to do as this memory is potentially used by the OS.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to give the user the possibility to manipulate hardware (like GPIOs) from the container - it can be enabled or disabled from the config. But yes, user shall take care and understand, that if they use it it's dangerous.

@kr-t kr-t merged commit f555f1b into main Nov 19, 2025
13 checks passed
@kr-t kr-t deleted the features/opcua branch November 19, 2025 10:09
PatrickRobbIOL pushed a commit to mgeeIOL/ocre-runtime that referenced this pull request Dec 1, 2025
Update wamr's hash to support networking DNS changes. 

---------

Signed-off-by: Krisztian Szilvasi <34309983+kr-t@users.noreply.github.com>
casaroli pushed a commit that referenced this pull request Dec 7, 2025
Update wamr's hash to support networking DNS changes.

---------

Signed-off-by: Krisztian Szilvasi <34309983+kr-t@users.noreply.github.com>
casaroli added a commit that referenced this pull request Jan 7, 2026
This reverts commit f555f1b.

This commit is kept in the legacy branch.
casaroli pushed a commit that referenced this pull request Jan 7, 2026
Update wamr's hash to support networking DNS changes.

---------

Signed-off-by: Krisztian Szilvasi <34309983+kr-t@users.noreply.github.com>
casaroli added a commit that referenced this pull request Jan 7, 2026
This reverts commit f555f1b.

This commit is kept in the legacy branch.

Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
casaroli pushed a commit that referenced this pull request Jan 7, 2026
Update wamr's hash to support networking DNS changes.

---------

Signed-off-by: Krisztian Szilvasi <34309983+kr-t@users.noreply.github.com>
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
casaroli pushed a commit that referenced this pull request Jan 7, 2026
Update wamr's hash to support networking DNS changes.

---------

Signed-off-by: Krisztian Szilvasi <34309983+kr-t@users.noreply.github.com>
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
casaroli added a commit that referenced this pull request Jan 7, 2026
This reverts commit f555f1b.

This commit is kept in the legacy branch.

Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
casaroli pushed a commit that referenced this pull request Jan 7, 2026
Update wamr's hash to support networking DNS changes.

---------

Signed-off-by: Krisztian Szilvasi <34309983+kr-t@users.noreply.github.com>
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants